<?php
/**
 * Created by PhpStorm.
 * User: Tmac
 * Date: 2017/12/6
 * Time: 11:18
 */

use Service\UserService;
use Wxxiong6\WxxLogger\WxxLogger as Logger;

class HomeController extends BaseController
{


    //获取首页数据
    public function pageAction()
    {
        $uid = $this->header['uid'];//用户ID
        $page = $this->getRequest()->getParam('page');//产品热销页码
        if (empty($page)) {
            $page = 1;
            Logger::warn('缺少参数page,参数为空');
        }
        $data = UserService::getInstance()->getHomePageData($uid, $page);
        $this->callback($data, APP_REQUEST_SUCCESS, '请求成功');
    }
}